/* use 1999 DADS data with O*Net Data to normalize values */
cd "M:\ImmPanelRevis17\donnees\cells\"
use "M:\ImmPanelRevis17\donnees\indivm.dta", clear

keep if an==1999
joinby cs2 using  "M:\ImmPanelRevis17\Donnees\Onet\CS2_Onet.dta", unm(m)
drop if _merge==1
egen zbasman=std(basman)
egen zexman=std(exman)
egen zbascom=std(bascom)
egen zexcom=std(excom)

xtile pbasman = basman, n(100)
xtile pexman = exman, n(100)
xtile pbascom = bascom, n(100)
xtile pexcom = excom, n(100)

replace pbasman=pbasman/100
replace pexman=pexman/100
replace pbascom=pbascom/100
replace pexcom=pexcom/100

contract cs2 basman exman bascom excom zbasman zexman zbascom zexcom pbasman pexman pbascom pexcom
rename cs2 cs2h
save "M:\ImmPanelRevis17\Donnees\Onet\CS2_OnetNorm.dta", replace
